package cn.com.jsepc.rep.dsdd;

import org.quartz.CronTrigger;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;

import java.util.Date;

/**
 *  */
/**
 * @author starsiday
 */
/**/ /*  实现Job  */

public class Dsdd implements Job {

    /**/ /*  重载该函数  */

    public void execute(JobExecutionContext cntxt) throws JobExecutionException {
        new DsddAutoSetValue().run();
    }
    
    public void run(){
         try {
            SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
            Scheduler sched = schedFact.getScheduler();
            sched.start();
            JobDetail jobDetail = new JobDetail(" Income Report ",
                    " Report Generation ", Dsdd.class);
            jobDetail.getJobDataMap().put(" type ", " FULL ");
            CronTrigger trigger = new CronTrigger(" Income Report ",
                    " Report Generation ");
            trigger.setCronExpression(" 0 21 17  * * ? ");
            sched.scheduleJob(jobDetail, trigger);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    public static void mian(String args[]){
    	new Dsdd().run();
    }
}
